Text Layout Attribute Tag Constants

You can pass a text layout attribute tag constant of type ATSUAttributeTag to the functions ATSUSetLayoutControls, ATSUGetLayoutControl, ATSUGetAllLayoutControls, and ATSUClearLayoutControls to identify the text layout attribute value you wish to set, obtain, or remove from a text layout object. If you do not set a text layout attribute, it will be set to its default value. Table C-2 lists the Apple-defined text layout attribute tags and their corresponding data type, size, and default values.

You can also pass these tag constants to the ATSUI functions ATSUSetLineControls, ATSUGetLineControl, ATSUGetAllLineControls, and ATSUClearLineControls to identify the text layout attribute value you wish to set, obtain, or remove from a single line in a text layout object. Note that when you set a text layout attribute value for a line, this value will override the value of the text layout attribute set for the text layout object containing the line. This is true even if the attributes for the line are set before those of the entire text layout object containing the line.

IMPORTANT

The ATSUAttributeTag type also defines style run attribute tag constants; see Style Run Attribute Tag Constants for a description of these tags. Note that if you pass style run attribute tags to functions that get, set, or remove text layout attribute values, the function will return the result code kATSUInvalidAttributeTagErr.

The following constant descriptions assume horizontal text. If you are setting or getting the text layout attribute of vertical text, you should interpret these values accordingly.

enum {
    kATSULineWidthTag                   = 1L,
    kATSULineRotationTag                = 2L,
    kATSULineDirectionTag               = 3L, 
    kATSULineJustificationFactorTag     = 4L, 
    kATSULineFlushFactorTag             = 5L, 
    kATSULineBaselineValuesTag          = 6L, 
    kATSULineLayoutOptionsTag           = 7L,
    kATSULineAscentTag                  = 8L,
    kATSULineDescentTag                 = 9L, 
    kATSULineLanguageTag                = 10L, 
    kATSULineTextLocatorTag             = 11L,  
    kATSUMaxLineTag                     = 12L 
};
typedef UInt32              ATSUAttributeTag;

Constant descriptions

kATSULineWidthTag
Identifies the line width attribute. You use this tag to set or obtain a value of type ATSUTextMeasurement that represents the line width to impose on a line of a text layout object. If you set this value to 0, ATSUI will act as if you have not set the line width. If you do not set the attribute value corresponding to this tag, the default value is 0, and ATSUI does not impose a line width. Available with ATSUI 1.0.

kATSULineRotationTag
Identifies the line rotation attribute. You use this tag to set or obtain a value of type Fixed that represents the angle of line rotation (in units of degrees) to impose on a line of a text layout object. Values can range from -1.0 to 1.0. A value of 0 indicates no line rotation. Negative values rotate the line clockwise, while positive values rotate the line counterclockwise. If you do not set the attribute value corresponding to this tag, the default value is 0, and ATSUI does not impose line rotation. Available with ATSUI 1.0.

kATSULineDirectionTag
Identifies the line direction attribute. You use this tag to set or obtain a value of type Boolean that represents the line direction to impose on every line of a text layout object. You cannot set line direction for a single line. See Glyph Direction Constants for a description of possible values. If you do not set the attribute value corresponding to this tag, the default value is false, and text direction is derived from the system script, which you can determine by calling the GetSysDirection function. Available with ATSUI 1.0.

kATSULineJustificationFactorTag
Identifies the line justification attribute. You use this tag to set or obtain a value of type Fract that represents the justification to impose on a line of a text layout object. Values can range from 0 to 1. See Line Justification Constants for a description of possible values. A value of 0 indicates no justification; a value of 1 indicates full justification. If you do not set the attribute value corresponding to this tag, the default value is kATSUNoJustification, and ATSUI does not impose line rotation. Available with ATSUI 1.0.

kATSULineFlushFactorTag
Identifies the line alignment attribute. You use this tag to set or obtain a value of type Fract that represents the alignment to impose on a line of a text layout object. If you set the line alignment attribute, you must also set line justification attribute for the corresponding line(s). Values can range from 0 to 1. See Line Alignment Constants for a description of possible values. A value of 0 indicates no alignment; a value of 1 indicates full alignment. If you specify the constants kATSUEndAlignment or kATSUCenterAlignment, you must also set the line width of the corresponding line(s). If you do not set the attribute value corresponding to this tag, the default value is kATSUStartAlignment, and ATSUI aligns text to the right of the left margin. Available with ATSUI 1.0.

kATSULineBaselineValuesTag
Identifies the baseline positions attribute. You use this tag to set or obtain an array of type BslnBaselineRecord that represents the optimal baseline positions to use in controlling glyph placement in a line of a text layout object. To determine this value, call the function ATSUCalculateBaselineDeltas and pass the style object corresponding to the dominant style run in the line. If you do not set the attribute value corresponding to this tag, the default value is an empty array, and ATSUI uses the font-defined cross-stream shift for each glyph in the line. Available with ATSUI 1.0.

kATSULineLayoutOptionsTag
Identifies the line layout options attribute. You use this tag to set or obtain a 32-bit mask value of type ATSLineLayoutOptions that controls line layout options for a single line or each line of a text layout object. See Line Layout Option Mask Constants for a description of possible values. If you do not set the attribute value corresponding to this tag, the default value is kATSUNoLayoutOptions, and ATSUI does not set any line layout options. Available with ATSUI 1.0.

kATSULineAscentTag
Identifies the line ascent attribute. You use this tag to set or obtain a value of type ATSUTextMeasurement that represents line ascent for a line of a text layout object. This attribute is only taken into account by the functions ATSUHighlightText and ATSUUnhighlightText to calculate the ascent of the highlight region. Values range from -1.0 to 1.0, though ATSUI ignores negative values. Nonnegative value reflect an incremental distance above the line's baseline. If you do not set the attribute value corresponding to this tag, the default value is kATSUseLineHeight, and ATSUI uses the calculated line ascent from the maximum ascent along the line of all the style runs. Available with ATSUI 1.1.

kATSULineDescentTag
Identifies the line descent attribute. You use this tag to set or obtain a value of type ATSUTextMeasurement that represents the line descent for a single line or each line of a text layout object. This attribute is only taken into account by the functions ATSUHighlightText and ATSUUnhighlightText to calculate the descent of the highlight region. Values range from -1.0 to 1.0, though ATSUI ignores negative values. Nonnegative value reflect an incremental distance below the line's baseline. If you do not set the attribute value corresponding to this tag, the default value is kATSUseLineHeight, and ATSUI uses the calculated line descent from the maximum descent along the line of all the style runs. Available with ATSUI 1.1.

kATSULineLanguageTag
Identifies the language attribute for a line. You use this tag to set or obtain a value of type RegionCode that represents the regional language and other region-dependent characteristics for glyphs in a line of a text layout object. See Region Code Constants for a description of possible values. If you do not set the attribute value corresponding to this tag, the default value is kTextRegionDontCare, and ATSUI uses the region code of the system script. To determine this value, evaluate the result of GetScriptVariable (smSystemScript,smScriptLang). Available with ATSUI 1.2.

kATSULineTextLocatorTag
Identifies the text locator attribute. You use this tag to set or obtain a value of type TextBreakLocatorRef that contains data needed by ATSUI to form various kind of text breaks. If you do not set the attribute value corresponding to this tag, the default value is NULL, and ATSUI uses the region-derived locator or the default Text Utilities locator. Available with ATSUI 1.2.

kATSUMaxLineTag
Identifies the maximum value for Apple-defined text layout attribute tags. Available with ATSUI 1.2.
VERSION NOTES
This enumeration is available beginning with ATSUI 1.0. Additional constants added with ATSUI 1.1 and 1.2.


© 2000 Apple Computer, Inc. – (Last Updated 25 Jan 00)